<%--
  Created by IntelliJ IDEA.
  User: Chuch
  Date: 2017/5/05
  Time: 11:25
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common/taglibs.jsp" %>
<html>
<head>
    <title>支付报表统计</title>
    <script src="${ctx}/js/views/payCount/payTransCountReport.js"></script>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
<core:import url="../common/pageHead.jsp">
    <core:param name="title" value="支付报表统计"/>
</core:import>
<div ng-controller="queryCtrl" class="container-fluid">
    <form id="queryForm" name="queryForm" action="${ctx}/count/pay/search"
          role="form" autocomplete="off">
        <table class="table table-bordered table-condensed">
            <tr>
                <td class="text-right">银行名称</td>
                <td>
                    <input type="text" ng-model="vm.queryBean.bankCode" class="{{vm.constant.inputClass}}"
                           typeahead-min-length="0"   uib-typeahead="item.key as item.value for item in vm.getCache('T_BANK_CODE') | filter:$viewValue | limitTo:10">
                </td>
                <td class="text-right">交易日期</td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup
                           ng-blur="vm.checkStartDay(vm.queryBean.startTime,vm.queryBean.endTime)"
                           ng-model="vm.queryBean.startTime" required/>
                    -
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup
                           ng-blur="vm.checkEndDay(vm.queryBean.startTime,vm.queryBean.endTime)"
                           ng-model="vm.queryBean.endTime" required/>
                </td>
            </tr>
            <tr align="center">
                <td colspan="6">
                    <button type="button" ng-click="vm.queryDetail()" class="btn btn-default">
                        查询
                    </button>
                    <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>
                    <shiro:hasPermission name="refund-report_download">
                        <button down-file="${ctx}/count/pay/download" params="vm.queryBean"
                                down-file-type="xls" class="btn btn-default" down-cfg="vm.downCfg">
                            下载
                        </button>
                    </shiro:hasPermission>
                </td>
            </tr>
        </table>
    </form>


    <div>
        <table table-detail>
            <thead>
            <tr>
                <th rowspan="2">序号</th>
                <th rowspan="2">支付机构</th>
                <th rowspan="2">银行名称</th>
                <th rowspan="2">交易开始日期</th>
                <th rowspan="2">交易结束日期</th>
                <th colspan="2">交易成功</th>
                <th colspan="2">交易失败</th>
                <th colspan="2"></th>
            </tr>
            <tr>
                <th>笔数</th>
                <th>金额(元)</th>
                <th>笔数</th>
                <th>金额(元)</th>
                <th>失败笔数占比</th>
            </tr>
            </thead>
            <tbody ng-repeat="bean in vm.list track by $index">
            <td>{{$index + 1}}</td>
            <td>
                <span ng-if="bean.orgCode == null">未知</span>
                <span ng-if="bean.orgCode != null">
                    {{vm.cached.COMANY_CODE[bean.orgCode]}}({{bean.orgCode}})
                </span>
            </td>
            <td>{{bean.bankName}}
            </td>
            <td>{{bean.startTime}}</td>
            <td>{{bean.endTime}}</td>
            <td>{{bean.paySuccessTotal}}</td>
            <td>{{bean.paySuccessMoney /100 | currency:''}}</td>
            <td>{{bean.payFailTotal}}</td>
            <td>{{bean.payFailMoney /100 | currency:''}}</td>
            <td>{{bean.payFailRate}}</td>
            </tbody>
            <tr>
                <td></td><td></td><td></td><td></td>
                <td>总计</td>
                <td>{{vm.totalCount.suc}}</td>
                <td>{{vm.totalCount.sucAmt /100 | currency:''}}</td>
                <td>{{vm.totalCount.fail}}</td>
                <td>{{vm.totalCount.failAmt /100 | currency:''}}</td>
                <td>{{vm.totalCount.failRate}}</td>
            </tr>
        </table>
    </div>
    <core:import url="../common/pageFoot.jsp"/>
</div>
<core:import url="../common/nav.jsp"/>
</body>
</html>

